﻿using System;
using System.Collections.Generic;
using Smart.Model;
using Smart.Business.CaloriesCalculator;

namespace Smart.Service
{
    /// <summary>
    /// Public Service implementation
    /// </summary>
    public class CaloriesCalculator : ICaloriesCalculator
    {
        #region CaloriesCalculator

       public List<MealCategory> GetAllCategories()
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            return ccbl.GetAllCategories();
        }

        public List<MealTiny> GetAllMeals()
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            List<MealTiny> res = ccbl.GetAllMeals();
            return res;
        }

        public List<MealTiny> GetAllMealsFromCategory(int catId)
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            return ccbl.GetAllMealsFromCategory(catId);
        }

       public CalculatedResult CalculateCaloriesForMeal(int mealId, int q)
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            return ccbl.CalculateCaloriesForMeal(mealId, q);
        }

       public CalculatedResult CalculateCalories(List<KeyValuePair<int, int>> list)
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            return ccbl.CalculateCalories(list);
        }


        public void RecordMeal(int userId, int mealId, int quantity)        
        {
            CaloriesCalculatorBL ccbl = new CaloriesCalculatorBL();
            ccbl.RecordMeal(userId, mealId, quantity);
        }

        #endregion
    }
}
